package com.aikon.wht.concurrent;

public class SuspendTest implements Runnable {

	private int i;

	public void run() {
		while (true) {
			System.out.println(i);
			i++;
			try {
				Thread.sleep(100);
			} catch (InterruptedException e) {
			}
		}

	}

	public static void main(String[] args) throws InterruptedException {
		SuspendTest suspendTest = new SuspendTest();
		Thread t = new Thread(suspendTest);
		t.start();
		Thread.sleep(1000);
		// while (true) {
		// if (suspendTest.i == 100) {
		t.suspend();
		Thread.sleep(1000);
		t.resume();
		// }
		// }

	}

	public class inner extends Thread {
		public void run() {

		}
	}

}
